<template>
  <div>
    <div class="container1">
      <div class="common-title-flex">
        <div class="common-title-div"></div>
        <div class="common-title-text">招聘会查询条件</div>
      </div>
      <el-form ref="searchObj" :inline="true" :model="searchObj" size="mini" label-width="100px" style="margin-bottom: -10px; margin-top: 10px">
        <el-form-item label="招聘会名称">
          <el-input v-model="searchObj.content" placeholder="请输入招聘会名称" clearable></el-input>
        </el-form-item>
        <el-form-item label="主办单位">
          <el-input v-model="searchObj.name" placeholder="请输入主办单位" clearable></el-input>
        </el-form-item>
        <el-form-item label="起止时间">
          <el-date-picker v-model="createTime" unlink-panels type="daterange" value-format="yyyyMMdd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item style="margin-left: 2rem">
          <el-button type="primary" icon="el-icon-search" @click="queryList">查询</el-button>
          <el-button @click="reset" icon="el-icon-refresh">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="container" style="margin-top: 1rem">
      <div class="common-list-class">
        <div style="display: flex">
          <div class="common-title-div"></div>
          <div class="common-title-text">招聘会查询列表</div>
        </div>
        <div style="display: flex">
          <!-- <el-upload
                    class="upload-file"
                    :headers="uploadHeader"
                    :before-upload="beforeUpload"
                    :action="uploadUrl"
                    :on-success="uploadSucess"
                    :on-error="uploadError"
                    :on-progress="uploadProgress"
                    :show-file-list="false">
                        <el-button type="primary" icon="el-icon-download">批量导入</el-button>
                    </el-upload>
                    <el-button type="primary" size="mini" style="height:32px;margin-left:10px;" @click="allExportClick" icon="el-icon-position">下载模版</el-button> -->
          <el-button type="primary" style="height: 32px" icon="el-icon-circle-plus-outline" v-if="typeCode=='society'" @click="addPolice">创建招聘会</el-button>
          <el-button type="primary" style="height: 32px" icon="el-icon-circle-plus-outline" v-if="typeCode=='business'" @click="perfectPolice">完善企业</el-button>
        </div>
      </div>
      <!-- 查询列表 -->
      <el-table :data="tableData" size="mini" :row-style="rowStyle" :header-cell-style="tableHeaderColor" style="width: 100%; margin-top: 10px; margin-bottom: 10px" @selection-change="handleSelectionChange" @cell-click="cellChange" max-height="550" border>
        <el-table-column type="selection" width="50" align="center">
        </el-table-column>
        <el-table-column prop="title" label="招聘会名称" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="beginTime" label="开始时间" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="endTime" label="结束时间" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="jobLocation" label="招聘会地点" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="sponsors" label="主办单位" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="introduce" label="招聘会介绍" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="applyEnterNum" label="申请参会企业数" show-overflow-tooltip align="center" v-if="typeCode !=='business' && typeCode !=='labour'">
          <template slot-scope="scope">
            <div style="font-weight:bold;cursor: pointer;color:#409eff;">{{scope.row.applyEnterNum}}</div>
          </template>
        </el-table-column>
        <el-table-column prop="postAttendedNum" label="参会岗位数" show-overflow-tooltip align="center" v-if="typeCode !=='business' && typeCode !=='labour'">
          <template slot-scope="scope">
            <div style="font-weight:bold;cursor: pointer;color:#409eff;">{{scope.row.postAttendedNum}}</div>
          </template>
        </el-table-column>
        <el-table-column prop="enterNum" label="参会企业数" show-overflow-tooltip align="center" v-if="typeCode !=='business' && typeCode !=='labour'">
          <template slot-scope="scope">
            <div style="font-weight:bold;cursor: pointer;color:#409eff;">{{scope.row.enterNum}}</div>
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="300" align="center">
          <template slot-scope="scope">
            <el-button type="text" size="mini" icon="el-icon-zoom-in" @click="lookdetailsClick(scope.row)">查看</el-button>
            <el-button type="text" size="mini" icon="el-icon-edit" style="color: orange" @click="editdetailsClick(scope.row)" v-if="typeCode=='society'">编辑</el-button>
            <el-button type="text" style="color: green" size="mini" icon="el-icon-s-promotion" @click="seeClick(scope.row)" v-if="typeCode=='society'">发送邀请</el-button>
            <el-button type="text" size="mini" icon="el-icon-s-promotion" v-if="(typeCode=='business' || typeCode=='labour') &&  scope.row.effective" @click="detailsClick(scope.row)">投递岗位</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页 -->
      <el-row type="flex" justify="end">
        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="pageSizes" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
      </el-row>
    </div>
    <!-- 创建招聘会 -->
    <el-dialog :title="isEditTitle" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="newaddFlag" width="50%" :before-close="cancel" center>
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">{{ isEditTitle }}</div>
      </div>
      <el-form ref="inputObj" :model="inputObj" label-width="120px" :rules="rules">
        <el-form-item label="招聘会名称" prop="title" class="required-content-red">
          <el-input v-model="inputObj.title" placeholder="请输入招聘会名称" clearable></el-input>
        </el-form-item>
        <el-form-item label="时间" prop="time" class="required-content-red">
          <el-date-picker style="width: 100%" :clearable="false" v-model="inputObj.time" unlink-panels type="daterange" @blur="dateChange" value-format="yyyyMMdd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="地点" prop="jobLocation" class="required-content-red">
          <el-input v-model="inputObj.jobLocation" placeholder="请输入地点" clearable></el-input>
        </el-form-item>
        <el-form-item label="包含行业" prop="industry" class="required-content-red">
          <el-input v-model="inputObj.industry" placeholder="请输入包含行业" clearable></el-input>
        </el-form-item>
        <el-form-item label="招聘会介绍" prop="introduce" class="required-content-red">
          <el-input v-model="inputObj.introduce" placeholder="请输入招聘会介绍" clearable></el-input>
        </el-form-item>
        <el-form-item label="参会要求" prop="require" class="required-content-red">
          <el-input v-model="inputObj.require" placeholder="请输入参会要求" clearable></el-input>
        </el-form-item>
        <el-form-item label="主办单位" prop="sponsors" class="required-content-red">
          <el-input v-model="inputObj.sponsors" placeholder="请输入主办单位" clearable></el-input>
        </el-form-item>
        <!-- 图片上传 -->
        <el-row flex>
          <el-col :span="20">
            <el-form-item label="上传图片" prop="username" class="changeImg required-content-red">
              <el-upload ref="uploadimg" :file-list="fileUrlList" :limit="1" :on-exceed="handleExceed" :headers="uploadHeader" :before-upload="beforeUploadClick" :on-success="onSucessMethod" :on-error="onErrorMethod" :action="uploadUrl" :data="uploadData" list-type="picture-card" :on-remove="handleRemove" :before-remove="beforeRemove2" width="50px">
                <i class="el-icon-plus"></i>
              </el-upload>
            </el-form-item>
          </el-col>
          <el-col>
            <div style="color: #aaa;display: block;text-align:center" font-size="12px">
              <div>尺寸：560px*340px (如尺寸不同，图片可能会被拉伸)</div>
              <div>只能上传jpg/png格式化文件，文件不能超过500kb</div>
            </div>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="addrecruit">提 交</el-button>
        <el-button @click="cancel">取 消</el-button>
      </span>
    </el-dialog>
    <!-- 完善企业 -->
    <el-dialog title="完善企业" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="perfectFlag" width="50%" :before-close="cancel">
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">完善企业</div>
      </div>
      <el-form :model="profileObj" ref="profileObj" class="demo-ruleForm" size="mini" label-width="150px" style="margin-bottom: -10px; margin-top: 10px">
        <el-row>

          <el-col :span="10">
            <el-form-item label="公司全称" class="required-content-red">
              <el-input v-model="profileObj.companyName" placeholder="请输入" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="公司简称">
              <el-input v-model="profileObj.companySynopsis" placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="公司地址" class="required-content-red">
              <el-input v-model="profileObj.companyAddr" placeholder="请输入" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="单位电话" class="required-content-red">
              <el-input v-model="profileObj.companyPhone" placeholder="请输入" disabled></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="10">
            <el-form-item label="社会信用代码" class="required-content-red">
              <el-input v-model="profileObj.companyCode" placeholder="请输入" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="注册日期" class="required-content-red">
              <el-input v-model="profileObj.registerTime" placeholder="请输入" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="注册资本" class="required-content-red">
              <el-input v-model="profileObj.registerFunds" placeholder="请输入" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="企业规模" class="required-content-red">
              <el-select v-model="profileObj.companyScale" clearable placeholder="请选择">
                <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="企业性质" class="required-content-red">
              <el-input v-model="profileObj.companyNature" placeholder="请输入" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="联系人" class="required-content-red">
              <el-input v-model="profileObj.managerName" placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="联系手机" class="required-content-red">
              <el-input v-model="profileObj.managerPhone" placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="企业网址">
              <el-input v-model="profileObj.companyNet" placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="20">
            <el-form-item label="企业介绍" class="required-content-red">
              <el-input v-model="profileObj.companyIntroduce" placeholder="请输入" type="textarea"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <el-form-item label="企业标签" class="required-content-red">
              <el-select v-model="enterpriseLabel" multiple collapse-tags placeholder="请选择" style="width:100%">
                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="3">
            <el-button type="info" size="mini" icon="el-icon-plus" style="margin-left:7px" plain @click="addcustomize">自定义标签</el-button>
          </el-col>

        </el-row>
        <el-row>
          <!-- 图片上传 -->
          <el-col :span="20">
            <el-form-item label="图片上传" class="required-content-red" style="margin:0">
              <el-upload ref="upload" :limit="6" :file-list="fileUrluploadList" :headers="uploadHeader" :on-exceed="handleExceed1" :on-error="onErrorMethod2" :action="uploadUrl" :data="uploadData2" class="avatar-uploader" list-type="picture-card" :on-success="handleAvatarSuccess" :before-upload="beforeUploadClick3" :on-remove="handleRemove1" :before-remove="beforeRemove1">
                <i class="el-icon-camera avatar-uploader-icon"></i>
              </el-upload>
              <!-- <el-dialog :visible.sync="dialogVisible2">
                <img width="100%" :src="dialogImageUrl2" alt="" />
              </el-dialog> -->
            </el-form-item>
          </el-col>
          <el-col style="width:100%">
            <div style="text-align:center;margin:5px 0">
              <div style="font-size: 12px;color: #aaa;">
                尺寸：560px*340px (如尺寸不同，图片可能会被拉伸)
              </div>
              <div style="font-size: 12px;color: #aaa;">
                只能上传jpg/png格式化文件，文件不能超过500kb
              </div>
              <span style="font-size: 12px;">最多上传6张</span>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <!-- 上传视频 -->
          <el-col :span="20">
            <el-form-item label="视频上传" style="margin:0">
              <el-upload class="avatar-uploader" ref="upload" :file-list="fileUrlList1" :limit="1" :on-exceed="handleExceed2" :headers="uploadHeader" :on-error="onErrorMethod3" :action="uploadUrl" :data="uploadDataVideo" :show-file-list="true" :on-success="handleVideoSuccess" :before-upload="beforeVideoUpload" :on-remove="handleRemove2 ">
                <img v-if="imageUrl" :src="imageUrl" class="avatar" />
                <i v-else class="el-icon-camera avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
          </el-col>
          <el-col style="width:100%;margin:10px 0">
            <div style="text-align:center;">
              <div style="font-size: 12px;color: #aaa;">
                大小：小于200M
              </div>
              <div style="font-size: 12px;color: #aaa;">
                视频格式支持：MP4、AVI、MOV、WMV等
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col style="margin-bottom: 20px" align="center">
            <el-button type="primary" @click="submitForm" icon="el-icon-search">取消</el-button>
            <el-button type="warning" @click="resetdetermine" icon="el-icon-search">提交</el-button>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
    <el-dialog title="自定义标签" :visible.sync="dialogcustomize">
      <el-input v-model="customize" placeholder="请输入自定义标签"></el-input>
      <div slot="footer" class="dialog-footer">
        <el-button @click="closedialogcustomize">取 消</el-button>
        <el-button type="primary" @click="adddialogcustomize">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 查看企业介绍 -->
    <el-dialog title="参看参会企业" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="newfindFlag" width="65%" :before-close="cancel" center :showClose="false">
      <el-table ref="multipleTable" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="70" align="center">
        </el-table-column>
        <el-table-column prop="enterPrise" label="企业名称" show-overflow-tooltip width="200" align="center">
        </el-table-column>
        <el-table-column prop="deliverTime" label="投递时间" show-overflow-tooltip width="150" align="center">
        </el-table-column>
        <el-table-column prop="postNumber" label="参会岗位数量" show-overflow-tooltip width="150" align="center">
        </el-table-column>
        <el-table-column prop="audit" label="审核结果" show-overflow-tooltip width="100" align="center">
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="150" align="center">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small" icon="el-icon-search">详情</el-button>
          </template>
        </el-table-column>
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="newfindClose">关 闭</el-button>
      </span>
    </el-dialog>
    <!-- 查看招聘会 -->
    <!-- <el-dialog title="查看" :visible.sync="newFlag" center width="50%">
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">查看</div>
      </div>
      <el-form :model="inputObj" label-width="100px" ref="inputObj">
        <el-form-item label="招聘会名称">
          <el-input v-model="inputObj.illegalName" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="时间">
          <el-input v-model="inputObj.illegalPhone" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="地点">
          <el-input v-model="inputObj.illegalIdentity" size="mini"></el-input>
        </el-form-item>

        <el-form-item label="参会要求">
          <el-input
            v-model="inputObj.content"
            size="mini"
            autocomplete="off"
            :row="2"
            type="textarea"
          ></el-input>
        </el-form-item>
        <el-form-item label="包含行业">
          <el-input
            v-model="inputObj.content"
            size="mini"
            autocomplete="off"
            :row="2"
            type="textarea"
          ></el-input>
        </el-form-item>
        <el-form-item label="招聘会行业">
          <el-input
            v-model="inputObj.content"
            size="mini"
            autocomplete="off"
            :row="2"
            type="textarea"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="addconfirm">确 定</el-button>
      </div>
    </el-dialog> -->
    <!-- 投递岗位 -->
    <el-dialog title="投递岗位" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="deliveryPost" :before-close="gangweicancel" center width="70%">
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">投递岗位</div>
      </div>
      <el-table :data="tablegangweiData" size="mini" :row-style="rowStyle" :header-cell-style="tableHeaderColor" @selection-change="handleSelectiongangweiChange" style="width: 100%; margin-top: 10px; margin-bottom: 10px" max-height="550" border>
        <el-table-column type="selection" :selectable="canSelect" width="55" align="center">
        </el-table-column>
        <el-table-column prop="stationName" label="岗位名称" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="stationTimeBetween" label="岗位时间" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="stationDesc" label="岗位描述" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="experienceDesc" label="经验要求" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="minEducationDesc" label="最低学历要求" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="salaryRange" label="薪资范围(元)" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="stationTags" label="岗位标签" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="canDelivery" label="是否可投递" show-overflow-tooltip align="center">
          <template slot-scope="scope">
            {{scope.row.canDelivery==true?"是":"否"}}
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页 -->
      <el-row type="flex" justify="end">
        <el-pagination background @size-change="handleSizeChange1" @current-change="handleCurrentChange1" :current-page="currentPage1" :page-sizes="pageSizes1" :page-size="pagesize1" layout="total, sizes, prev, pager, next, jumper" :total="total1">
        </el-pagination>
      </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="gangweicancel">取 消</el-button>
        <el-button type="primary" size="mini" @click="addconfirm">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 参会 -->
    <el-dialog :title="canjiashenqtitle" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="canhuiqiyeFlag" :before-close="canhuiqiyecancel" center width="60%">
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">{{canjiashenqtitle}}</div>
      </div>
      <div style="display:flex;justify-content: space-between;" v-if="canjiashenqtitle == '申请参会企业数'">
        <div></div>
        <div>
          <el-button size="mini" type="primary" @click="allshenheClick">批量通过</el-button>
        </div>
      </div>
      <el-table :data="tableqiyeData" size="mini" :row-style="rowStyle" :header-cell-style="tableHeaderColor" @selection-change="handleSelectionqiyeChange" style="width: 100%; margin-top: 10px; margin-bottom: 10px" max-height="550" border>
        <el-table-column type="selection" width="55" align="center">
        </el-table-column>
        <el-table-column prop="companyName" label="企业名称" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="createTime" label="投递时间" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="postAttendedNum" label="参会岗位数量" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="checkStatus" label="审核结果" show-overflow-tooltip align="center">
          <template slot-scope="scope">
            {{checkStatusObj[scope.row.checkStatus]}}
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="150" align="center">
          <template slot-scope="scope">
            <el-button @click="detailssqClick(scope.row)" type="text" size="mini" icon="el-icon-search">详 情</el-button>
            <el-button v-if="canjiashenqtitle == '申请参会企业数'" @click="shenhesqClick(scope.row)" type="text" size="mini" icon="el-icon-check">通 过</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页 -->
      <el-row type="flex" justify="end">
        <el-pagination background @size-change="handleSizeChange2" @current-change="handleCurrentChange2" :current-page="currentPage2" :page-sizes="pageSizes2" :page-size="pagesize2" layout="total, sizes, prev, pager, next, jumper" :total="total2">
        </el-pagination>
      </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="canhuiqiyecancel">关 闭</el-button>
      </div>
    </el-dialog>
    <!-- 查看岗位数量 -->
    <el-dialog title="岗位详情" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="canhuigangweiFlag" :before-close="canhuigwClose" center width="80%">
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">岗位详情</div>
      </div>
      <el-table :data="tablegwList" size="mini" :row-style="rowStyle" :header-cell-style="tableHeaderColor" style="width: 100%; margin-top: 10px; margin-bottom: 10px" max-height="550" border>
        <el-table-column prop="stationName" label="岗位名称" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="jobStatusDesc" label="是否急招" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="stationDesc" label="岗位描述" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="experienceDesc" label="经验要求" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="minEducationDesc" label="最低学历要求" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="salaryRange" label="薪资范围(元)" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="stationTags" label="岗位标签" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="companyName" label="公司名称" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="150" align="center">
          <template slot-scope="scope">
            <el-button @click="detailsgwClick(scope.row)" type="text" size="mini" icon="el-icon-search">详 情</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页 -->
      <el-row type="flex" justify="end">
        <el-pagination background @size-change="handleSizeChange3" @current-change="handleCurrentChange3" :current-page="currentPage3" :page-sizes="pageSizes3" :page-size="pagesize3" layout="total, sizes, prev, pager, next, jumper" :total="total3">
        </el-pagination>
      </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="canhuigwClose">关 闭</el-button>
      </div>
    </el-dialog>
    <!-- 详情 -->
    <el-dialog title="企业详情" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="detailsqiyeFlag" width="40%" :before-close="detailsqiyeClose" center>
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">企业详情</div>
      </div>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">公司全称</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsqiyeObj.companyName }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">公司简介</el-col>
        <el-col :span="15" class="grey-class">{{ detailsqiyeObj.companySynopsis }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">公司地址</el-col>
        <el-col :span="15" class="grey-class">{{ detailsqiyeObj.companyAddr }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">公司电话</el-col>
        <el-col :span="15" class="grey-class">{{
          detailsqiyeObj.companyPhone
        }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">社会信用代码</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsqiyeObj.companyCode }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">注册日期</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsqiyeObj.registerTime }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">注册资本</el-col>
        <el-col :span="15" class="grey-class">{{ detailsqiyeObj.registerFunds }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">企业规模</el-col>
        <el-col :span="15" class="grey-class">{{ detailsqiyeObj.companyScale }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">企业性质</el-col>
        <el-col :span="15" class="grey-class">{{ detailsqiyeObj.companyNature }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">企业网址</el-col>
        <el-col :span="15" class="grey-class">{{ detailsqiyeObj.companyNet }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">企业介绍</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsqiyeObj.companyIntroduce }}</el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="detailsqiyeClose">关 闭</el-button>
      </span>
    </el-dialog>
    <!-- 岗位介绍详情 -->
    <el-dialog title="岗位详情" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="detailsgangweiFlag" width="40%" :before-close="detailsgangweiClose" center>
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">岗位详情</div>
      </div>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">岗位名称</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsGWObj.stationName }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">是否急招</el-col>
        <el-col :span="15" class="grey-class">{{ detailsGWObj.jobStatusDesc }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">经验要求</el-col>
        <el-col :span="15" class="grey-class">{{ detailsGWObj.experienceDesc }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">学历要求</el-col>
        <el-col :span="15" class="grey-class">{{
          detailsGWObj.minEducationDesc
        }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">薪资范围(元)</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsGWObj.salaryRange }}(元)</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">岗位标签</el-col>
        <el-col :span="15" :title="detailsGWObj.stationTags" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsGWObj.stationTags }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">岗位描述</el-col>
        <el-col :span="15" :title="detailsGWObj.stationDesc" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsGWObj.stationDesc }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">公司名称</el-col>
        <el-col :span="15" class="grey-class">{{ detailsGWObj.companyName }}</el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="detailsgangweiClose">关 闭</el-button>
      </span>
    </el-dialog>
    <!-- 招聘会详情详情 -->
    <el-dialog title="招聘会详情" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="zhaopinhuiFlag" width="40%" :before-close="zhaopinhuiClose" center>
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">招聘会详情</div>
      </div>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">招聘会名称</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ zhaopinhuiObj.title }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">开始时间</el-col>
        <el-col :span="15" class="grey-class">{{ zhaopinhuiObj.beginTime }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">结束时间</el-col>
        <el-col :span="15" class="grey-class">{{ zhaopinhuiObj.endTime }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">招聘会地点</el-col>
        <el-col :span="15" class="grey-class">{{
          zhaopinhuiObj.jobLocation
        }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">主办单位</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ zhaopinhuiObj.sponsors }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">招聘会介绍</el-col>
        <el-col :span="15" :title="zhaopinhuiObj.introduce" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ zhaopinhuiObj.introduce }}</el-col>
      </el-row>
      <el-row type="flex" justify="center" v-if="typeCode =='society'">
        <el-col :span="4" class="bold-class">申请参会企业数</el-col>
        <el-col :span="15" :title="zhaopinhuiObj.applyEnterNum" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ zhaopinhuiObj.applyEnterNum }}</el-col>
      </el-row>
      <el-row type="flex" justify="center" v-if="typeCode =='society'">
        <el-col :span="4" class="bold-class">参会岗位数</el-col>
        <el-col :span="15" class="grey-class">{{ zhaopinhuiObj.postAttendedNum }}</el-col>
      </el-row>
      <el-row type="flex" justify="center" v-if="typeCode =='society'">
        <el-col :span="4" class="bold-class">参会企业数</el-col>
        <el-col :span="15" class="grey-class">{{ zhaopinhuiObj.enterNum }}</el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="zhaopinhuiClose">关 闭</el-button>
      </span>
    </el-dialog>
    <!-- 温馨提示 -->
    <el-dialog title="温馨提示" :visible.sync="centerDialogVisible" width="30%" center>
      <div>
        <span style="text-align:center;display:block;font-weight:bold;">请先完成以下信息后进行投递
          <div>1.企业介绍</div>
          <div>2.岗位</div>
        </span>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="centerDialogVisible = false">关 闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import mixin from "@/mixin/mixin.js";
export default {
  name: "meeting",
  mixins: [mixin],
  data() {
    return {
      fileUrluploadList: [],
      fileUrlList: [],
      fileUrlList1: [],
      UrlList: [],
      zhaopinhuiObj: {},
      zhaopinhuiFlag: false,
      detailsGWObj: {},
      detailsgangweiFlag: false,
      centerDialogVisible: false,
      tablegwList: [],
      detailsqiyeObj: {},
      detailsqiyeFlag: false,
      checkStatusObj: {
        0: "待审核",
        1: "通过",
        2: "驳回",
      },

      canhuiqiyeFlag: false,
      tableqiyeData: [],
      canjiashenqtitle: "",
      tablegangweiData: [],
      newFlag: false,
      createTime: [],
      progressFlag: false,
      uploadHeader: {},
      uploadUrl: "/wgry/hire/uploadAttachment",
      uploadData: {},
      uploadData2: {},
      uploadDataVideo: {},
      customize: "",
      rules: {
        remark: [
          { required: true, message: "请输入反馈内容", trigger: "blur" },
        ],
      },
      currentFildId: "",
      options: [
        {
          value: "定期团建",
          label: "定期团建",
        },
        {
          value: "综合补贴",
          label: "综合补贴",
        },
        {
          value: "包吃包住",
          label: "包吃包住",
        },
        {
          value: "五险一金",
          label: "五险一金",
        },
        {
          value: "绩效奖励",
          label: "绩效奖励",
        },
        {
          value: "年终奖励",
          label: "年终奖励",
        },
        {
          value: "员工旅游",
          label: "员工旅游",
        },
        {
          value: "节日福利",
          label: "节日福利",
        },
        {
          value: "周末双休",
          label: "周末双休",
        },
        {
          value: "带薪休假",
          label: "带薪休假",
        },
      ],
      enterpriseLabel: [],
      multipleSelection: [],

      detailsObj: {
        companyName: "江苏省南京市有限公司",
        industyType: "IT行业",
        relationMan: "张三",
        positionPost: "负责人",
        relationPhone: "139282930303",
        companyStation: "南京市新港区29号",
        companyPhone: "025-12321321321",
      },
      selectList: [],
      imageUrl: "",
      dialogImageUrl: "",
      dialogImageUrl2: "",
      dialogVisible: false,
      dialogVisible2: false,
      dialogcustomize: false,
      inputObj: {},
      detailsFlag: false,
      deliveryPost: false,
      isEditTitle: "",
      newaddFlag: false,
      perfectFlag: false,
      findFlag: false,
      newfindFlag: false,
      pageSizes: [10, 15, 50, 100],
      pagesize: 10,
      total: 10,
      currentPage: 1,
      pageSizes1: [50, 100, 200],
      pagesize1: 50,
      total1: 10,
      currentPage1: 1,
      pageSizes2: [50, 100, 200],
      pagesize2: 50,
      total2: 10,
      currentPage2: 1,
      pageSizes3: [50, 100, 200],
      pagesize3: 50,
      total3: 10,
      currentPage3: 1,
      tableData: [],
      searchObj: {},
      fileId: "",
      enterpriseId: "",
      videoId: "",
      fileIdList: [],
      addlable: [],
      //完善企业
      profileObj: {},
      newtagLIst: [],
      checkList: [],
      tagList: "",
      tagList1: [],
      selectqiyeList: [],
      jobCreentId: "",
      canhuigangweiFlag: false,
      currentdetailsId: "",
      flag: "",
      videoCode: "",
      //企业规模
      options1: [
        {
          value: "0",
          label: "10-50",
        },
        {
          value: "1",
          label: "50-100",
        },
        {
          value: "2",
          label: "100-200",
        },
        {
          value: "3",
          label: "200-500",
        },
        {
          value: "4",
          label: "500-1000",
        },
        {
          value: "5",
          label: "1000人以上",
        },
      ],
    };
  },
  created() {
    this.uploadHeader.Authorization = this.requestToken;
    this.queryList();
  },
  methods: {
    //是否禁用checkbox
    canSelect(row) {
      if (row.canDelivery == false) {
        return false;
      } else {
        return true;
      }
    },
    dateChange(value) {
      this.$forceUpdate();
    },
    editdetailsClick(row) {
      this.isEditTitle = "编辑招聘会";
      this.flag = 1;
      this.uploadData = {
        relativeId: "",
        attachmentType: "0",
      };
      this.currentdetailsId = row.id;
      let params = {
        jobId: row.id,
      };
      this.showLoading();
      this.$axios({
        method: "get",
        url: `/hire/queryJobDetail`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
        params: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == 20000) {
            this.newaddFlag = true;
            this.inputObj = res.data.data;
            this.inputObj.time = [
              res.data.data.beginTime,
              res.data.data.endTime,
            ];
            if (
              res.data.data.attachmentAddr &&
              res.data.data.attachmentAddr.length
            ) {
              this.fileUrlList = [
                {
                  url: res.data.data.attachmentAddr,
                  fileId: res.data.data.fileId,
                },
              ];
              this.fileId = res.data.data.fileId;
            } else {
              this.fileUrlList = [];
            }
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    zhaopinhuiClose() {
      this.zhaopinhuiFlag = false;
    },
    lookdetailsClick(row) {
      this.zhaopinhuiObj = row;
      this.zhaopinhuiFlag = true;
    },
    detailsgangweiClose() {
      this.detailsgangweiFlag = false;
    },
    canhuigwClose() {
      this.canhuigangweiFlag = false;
    },
    detailsqiyeClose() {
      this.detailsqiyeFlag = false;
    },
    detailsgwClick(row) {
      this.detailsgangweiFlag = true;
      this.detailsGWObj = row;
    },
    detailssqClick(row) {
      let params = {
        orgCode: row.orgCode,
      };
      this.showLoading();
      this.$axios({
        method: "get",
        url: `/hire/queryEnterpriseIntroduce`,
        headers: {
          Authorization: this.requestToken,
        },
        params: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.detailsqiyeFlag = true;
            this.detailsqiyeObj = res.data.data;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    shenhesqClick(row) {
      let self = this;
      let params = {
        checkStatus: "1",
        enterpriseIdList: [row.id],
        jobId: self.jobCreentId,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/checkEnterprise`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.$message.success("审核成功！");
            self.displayCompany(0, self.jobCreentId);
            this.queryList();
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    allshenheClick() {
      let self = this;
      if (!self.selectqiyeList || !self.selectqiyeList.length) {
        self.$message.error("请选择数据！");
        return;
      }
      let params = {
        checkStatus: "1",
        enterpriseIdList: self.selectqiyeList.map((value) => value["id"]),
        jobId: self.jobCreentId,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/checkEnterprise`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.$message.success("审核成功！");
            self.displayCompany(0, self.jobCreentId);
            this.queryList();
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    handleSelectionqiyeChange(value) {
      console.log(value);
      this.selectqiyeList = value;
    },
    cellChange(row, column, cell, event) {
      this.jobCreentId = row.id;
      if (column.label == "申请参会企业数") {
        this.canjiashenqtitle = "申请参会企业数";
        this.canhuiqiyeFlag = true;
        this.displayCompany(0, row.id);
      } else if (column.label == "参会企业数") {
        this.canjiashenqtitle = "参会企业数";
        this.canhuiqiyeFlag = true;
        this.displayCompany(1, row.id);
      } else if (column.label == "参会岗位数") {
        this.canhuigangweiFlag = true;
        this.displayGangwei();
      }
    },
    displayGangwei() {
      let params = {
        jobId: this.jobCreentId,
        pageNumber: this.currentPage3,
        pageSize: this.pagesize3,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/queryAttendingJobStationByPage`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.tablegwList = res.data.data.list;
            this.pagesize3 = res.data.data.pageSize;
            this.total3 = res.data.data.total;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    displayCompany(value, id) {
      let params = {
        checkStatus: value,
        jobId: id,
        pageNumber: this.currentPage2,
        pageSize: this.pagesize2,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/queryAttendingEnterPriseByPage`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.tableqiyeData = res.data.data.list;
            this.pagesize2 = res.data.data.pageSize;
            this.total2 = res.data.data.total;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    queryGangwei() {
      let params = {
        pageNumber: this.currentPage1,
        pageSize: this.pagesize1,
        qucryType: 1,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/queryJobStations`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.deliveryPost = true;
            this.tablegangweiData = res.data.data.list;
            this.pagesize1 = res.data.data.pageSize;
            this.total1 = res.data.data.total;
          } else if (res.data.code == "40003") {
            this.centerDialogVisible = true;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    detailsClick(row) {
      this.currentzpId = row.id;
      // this.queryGangwei();
      let params = {
        pageNumber: this.currentPage1,
        pageSize: this.pagesize1,
        queryType: 1,
        jobId: this.currentzpId,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/queryJobStations`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.deliveryPost = true;
            this.tablegangweiData = res.data.data.list;
            this.pagesize1 = res.data.data.pageSize;
            this.total1 = res.data.data.total;
          } else if (res.data.code == "40003") {
            this.centerDialogVisible = true;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    closedialogcustomize() {
      this.dialogcustomize = false;
    },

    adddialogcustomize() {
      let param = {
        value: this.customize,
        label: this.customize,
      };
      this.options.push(param);
      this.enterpriseLabel.push(this.customize);
      this.dialogcustomize = false;
      console.log(this.customize);
    },
    addcustomize() {
      this.dialogcustomize = true;
      this.customize = "";
    },
    submitForm() {
      this.perfectFlag = false;
      this.$refs.upload.clearFiles();
    },

    addrecruit() {
      this.submit();
      // this.inputObj = {};
      // this.$refs.upload.clearFiles();
    },
    handleExceed(files, fileList) {
      this.$message.warning("只能上传1张图片");
    },
    handleExceed1(files, fileList) {
      this.$message.warning("最多只能上传6张图片");
    },
    handleExceed2(files, fileList) {
      this.$message.warning("只能上传1个视频");
    },
    beforeUploadClick3(file) {
      this.showLoading("上传中");
      console.log("before------>", file);
      const isJPG =
        file.type == "image/jpeg" ||
        file.type == "image/png" ||
        file.type == "image/jpg";
      const isLt2M = file.size / 1024 / 1024 < 0.5;
      if (!isJPG) {
        this.hideLoading();
        this.$message.warning("上传头像图片只能是 JPG/PNG 格式!");
        return isJPG;
      }
      if (!isLt2M) {
        this.hideLoading();
        this.$message.warning("上传头像图片大小不能超过 500KB!");
        return isLt2M;
      }
      // this.multfileImg = file;
      return isJPG && isLt2M;
    },
    beforeUploadClick(file) {
      this.showLoading("上传中");
      console.log("before------>", file);
      const isJPG =
        file.type == "image/jpeg" ||
        file.type == "image/png" ||
        file.type == "image/jpg";
      const isLt2M = file.size / 1024 / 1024 < 0.5;
      if (!isJPG) {
        this.hideLoading();
        this.$message.warning("上传头像图片只能是 JPG/PNG 格式!");
        return isJPG;
      }
      if (!isLt2M) {
        this.hideLoading();
        this.$message.warning("上传头像图片大小不能超过 500KB!");
        return isLt2M;
      }
      // this.multfileImg = file;
      return isJPG && isLt2M;
    },
    beforeAvatarUpload(file) {
      console.log("before", file);
    },
    beforeVideoUpload(file) {
      this.showLoading("上传中");
      console.log("before---video", file);
      const isJPG =
        file.type == "video/mp4" ||
        file.type == "video/avi" ||
        file.type == "video/mov" ||
        file.type == "video/wmv";
      const isLt2M = file.size / 1024 / 1024 < 200;
      if (!isJPG) {
        this.$message.warning("上传视频只能是 MP4/AVI/MOV/wmv 格式!");
        this.hideLoading();
        return isJPG;
      }
      if (!isLt2M) {
        this.$message.warning("上传视频大小不能超过 200M!");
        this.hideLoading();
        return isLt2M;
      }
      // this.multfileImg = file;
      return isJPG && isLt2M;
    },
    onErrorMethod(err) {
      this.hideLoading();
      console.log("err-----", err);
    },
    onErrorMethod2(err) {
      console.log("err-----", err);
      this.$message.warning("上传失败，图片最低上传6张");
    },
    onErrorMethod3(err) {
      console.log("err-----video", err);
    },
    onSucessMethod(response, file) {
      this.showLoading();
      console.log("response----", response);
      console.log("file---", file);
      this.dialogImageUrl = file.url;
      // this.dialogVisible = true;
      if (response.code == 20000) {
        this.fileId = response.data.id;
        this.fileUrlList = [
          {
            url: response.data.attachmentAddr,
            fileId: response.data.id,
          },
        ];
        // this.fileUrlList = [
        //   { url: response.data.attachmentAddr, fileId: response.data.id },
        // ];
        this.$message.success("上传图片成功");
        this.hideLoading();
      } else {
        this.hideLoading();
        this.$message.error("上传图片失败");
      }
    },
    handleAvatarSuccess(response, file) {
      console.log("response----", response);
      this.dialogImageUrl2 = file.url;
      // this.dialogVisible2 = true;
      if (response.code == 20000) {
        this.hideLoading();
        this.fileIdList.push(response.data.id);
        this.fileUrluploadList.push({
          url: response.data.attachmentAddr,
          fileId: response.data.id,
        });
        this.$message.success("上传图片成功");
      } else {
        this.hideLoading();
        this.$message.error("上传图片失败");
      }
    },
    handleVideoSuccess(response) {
      console.log("response----", response);
      if (response.code == 20000) {
        this.hideLoading();
        this.fileIdList.push(response.data.id);
        this.$message.success("上传视频成功");
      } else {
        this.hideLoading();
        this.$message.error("上传视频失败");
      }
    },
    addconfirm() {
      let self = this;
      if (!self.selectList || !self.selectList.length) {
        self.$message.error("请选择投递岗位！");
        return;
      }
      let params = {
        jobId: self.currentzpId,
        jobStationIds: self.selectList.map((value) => value["id"]),
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/addJobStation`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.$message.success("投递成功！");
            this.queryList();
            this.deliveryPost = false;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    canhuiqiyecancel() {
      this.canhuiqiyeFlag = false;
      this.tableqiyeData = [];
    },
    gangweicancel() {
      this.deliveryPost = false;
      this.tablegangweiData = [];
    },
    //查询
    handleSelectiongangweiChange(value) {
      this.selectList = value;
    },
    tableHeaderColor({ row, column, rowIndex, columnIndex }) {
      return "background-color:#f5f5f5;color:#626262;";
    },
    rowStyle({ row, rowIndex }) {
      let style1 = {};
      let style2 = {};
      if (rowIndex % 2 == 0) {
        style1.background = "#ffffff";
        return style1;
      } else {
        style2.background = "#f5f5f5";
        return style2;
      }
    },
    allExportClick() {},
    queryList() {
      console.log(151515);
      let self = this;
      let begintime = "";
      let endtime = "";
      if (self.createTime && self.createTime.length) {
        begintime = self.createTime[0];
        endtime = self.createTime[1];
      } else {
        begintime = "";
        endtime = "";
      }
      let params = {
        id: this.searchObj.id,
        title: this.searchObj.content,
        sponsors: this.searchObj.name,
        beginTime: begintime,
        endTime: endtime,
        pageNumber: this.currentPage,
        pageSize: this.pagesize,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/queryJobByPage`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.tableData = res.data.data.list;
            // this.profileObj = res.data.data.list;

            // this.pagesize = res.data.data.pageSize;
            this.total = res.data.data.total;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    beforeUpload(file) {
      this.showLoading("导入中");
    },
    uploadProgress(event, file, fileList) {
      this.videoUploadPercent = file.percentage.toFixed(0) + "%";
      console.log("event--------", event);
      console.log("file--------", file);
      console.log("fileList--------", fileList);
    },
    uploadSucess(response) {
      this.$message({
        message: "导入成功！",
        type: "success",
      });
      this.hideLoading();
      console.log("response------", response);
    },
    uploadError(error) {
      this.$message({
        message: "导入失败！",
        type: "error",
      });
      this.hideLoading();
      console.log("error-----", error);
    },
    //完善企业介绍
    resetdetermine() {
      let self = this;
      let phoneCodeVerification = /^1[0-9]{10}$/;
      if (!phoneCodeVerification.test(self.profileObj.managerPhone)) {
        self.$message.error("请填写正确手机号");
        return;
      }
      if (!self.fileUrluploadList.length) {
        self.$message.error("请上传图片");
        return;
      }
      if (!self.profileObj.managerName) {
        self.$message.error("请填写联系人");
        return;
      }
      if (!self.enterpriseLabel) {
        self.$message.error("请选择企业标签");
        return;
      }
      if (!self.profileObj.companyScale) {
        self.$message.error("请选择企业规模");
        return;
      }
      if (!self.profileObj.companyIntroduce) {
        self.$message.error("请填写企业介绍");
        return;
      }
      let params = {
        companyCode: this.profileObj.companyCode,
        companyName: this.profileObj.companyName,
        companySynopsis: this.profileObj.companySynopsis,
        companyAddr: this.profileObj.companyAddr,
        companyNature: this.profileObj.companyNature,
        companyPhone: this.profileObj.companyPhone,
        registerFunds: this.profileObj.registerFunds,
        companyScale: this.profileObj.companyScale,
        managerName: this.profileObj.managerName,
        managerPhone: this.profileObj.managerPhone,
        companyNet: this.profileObj.companyNet,
        companyIntroduce: this.profileObj.companyIntroduce,
        tagList: this.enterpriseLabel,
        registerTime: this.profileObj.registerTime,
        fileIdList: this.fileIdList,
        // pageNumber: this.currentPage,
        // pageSize: this.pagesize,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/editEnterpriseInfo`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            self.$message.success("以完善企业介绍");
            this.perfectFlag = false;
            let videoCode = res.data.code;
            this.$refs.upload.clearFiles();
            this.profileObj = {};
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    // 新建确认和修改确认
    submit() {
      let self = this;
      console.log("fileUrlList-------", this.fileUrlList);
      let begintime = "";
      let endtime = "";
      if (self.inputObj.time && self.inputObj.time.length) {
        begintime = self.inputObj.time[0];
        endtime = self.inputObj.time[1];
      }
      if (!self.inputObj.title) {
        self.$message.error("请输入招聘会名称");
        return;
      }
      if (!self.inputObj.time || !self.inputObj.time.length) {
        self.$message.error("请选择时间！");
        return;
      }
      if (!self.inputObj.industry) {
        self.$message.error("请输入包含行业");
        return;
      }

      if (!self.inputObj.jobLocation) {
        self.$message.error("请输入地点");
        return;
      }
      if (!self.inputObj.introduce) {
        self.$message.error("请输入招聘会介绍");
        return;
      }
      if (!self.inputObj.require) {
        self.$message.error("请输入招聘会要求");
        return;
      }
      if (!self.inputObj.sponsors) {
        self.$message.error("请输入主办方单位");
        return;
      }
      if (!self.fileUrlList.length) {
        self.$message.error("请上传图片");
        return;
      }
      let params = {
        tnJobInfoDO: {
          title: self.inputObj.title,
          beginTime: begintime,
          endTime: endtime,
          industry: self.inputObj.industry,
          introduce: self.inputObj.introduce,
          require: self.inputObj.require,
          sponsors: self.inputObj.sponsors,
          jobLocation: self.inputObj.jobLocation,
        },
        fileId: self.fileId,
      };
      let url = "";
      if (self.isEditTitle == "创建招聘会") {
        url = "/hire/addJob";
      } else {
        url = "/hire/editJob";
        params.tnJobInfoDO.id = self.currentdetailsId;
      }
      this.showLoading();
      this.$axios({
        method: "post",
        url: url,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
        params: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            self.$message.success(
              self.isEditTitle == "创建招聘会" ? "创建成功！" : "修改成功！"
            );
            self.newaddFlag = false;
            self.queryList();
            this.inputObj = {};
            this.$refs.uploadimg.clearFiles();
            this.fileId = "";
            this.fileUrlList = [];
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    // 取消点击
    cancel() {
      this.newaddFlag = false;
      this.inputObj = {};
      this.fileUrlList = [];
      this.perfectFlag = false;
    },
    // 取消点击
    handleClose() {
      this.cancel();
    },
    // 点击分页当前页多少数据
    handleSizeChange(val) {
      this.pagesize = val;
      this.queryList();
    },
    handleSizeChange3(val) {
      this.pagesize3 = val;
      this.displayGangwei();
    },
    // 点击分页页数
    handleCurrentChange3(val) {
      this.currentPage3 = val;
      this.displayGangwei();
    },
    handleSizeChange1(val) {
      this.pagesize1 = val;
      this.queryGangwei();
    },
    // 点击分页页数
    handleCurrentChange1(val) {
      this.currentPage1 = val;
      this.queryGangwei();
    },
    handleSizeChange2(val) {
      this.pagesize2 = val;
      let num = "";
      let id = this.jobCreentId;
      if ((this.canjiashenqtitle = "申请参会企业数")) {
        num = 0;
      } else {
        num = 1;
      }
      this.displayCompany(num, id);
    },
    // 点击分页页数
    handleCurrentChange2(val) {
      this.currentPage2 = val;
      let num = "";
      let id = this.jobCreentId;
      if ((this.canjiashenqtitle = "申请参会企业数")) {
        num = 0;
      } else {
        num = 1;
      }
      this.displayCompany(num, id);
    },
    // 点击分页页数
    handleCurrentChange(val) {
      this.currentPage = val;
      this.queryList();
    },
    //  重置
    reset() {
      this.searchObj = {};
      this.createTime = [];
      this.queryList();
    },
    progressClose() {
      this.progressFlag = false;
    },
    addPolice() {
      this.newaddFlag = true;
      this.isEditTitle = "创建招聘会";
      this.flag = 0;
      this.uploadData = {
        relativeId: "",
        attachmentType: "0",
      };
    },

    //完善企业信息
    perfectPolice() {
      let self = this;
      this.perfectFlag = true;
      this.showLoading();
      this.$axios({
        method: "get",
        url: `/hire/queryEnterpriseBaseInfo`,
        headers: {
          Authorization: this.requestToken,
        },
        // data: params,
        // params: params
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.profileObj = res.data.data;
            this.currentFildId = res.data.data.relativeId;
            let videofile = res.data.data.attachmentAvi || {};
            // shipin
            if (videofile.attachmentAddr && videofile.attachmentAddr.length) {
              this.fileUrlList1 = [
                {
                  name: videofile.attachmentName,
                  url: videofile.attachmentAddr,
                  fileId: videofile.id,
                },
              ];
            } else {
              this.fileUrlList1 = [];
            }
            console.log(videofile);

            let biaoarry = res.data.data.tagList || [];
            console.log("self.options----", self.options);
            biaoarry.forEach((item) => {
              if (!self.options.map((val) => val["value"]).includes(item)) {
                self.options.push({
                  value: item,
                  label: item,
                });
              }
            });
            this.enterpriseLabel = res.data.data.tagList;
            // console.log("newtag----->", this.newtagLIst);
            this.UrlList = res.data.data.attachmentPicList || [];
            console.log(this.UrlList);
            let list = [];
            this.UrlList.forEach((item) => {
              list.push({
                url: item.attachmentAddr,
                fileId: item.id,
              });
            });

            this.fileUrluploadList = list;
            this.uploadData2 = {
              relativeId: this.currentFildId || "",
              attachmentType: "1",
            };
            this.uploadDataVideo = {
              relativeId: this.currentFildId || "",
              attachmentType: "2",
            };

            // this.pagesize = res.data.data.pageSize;
            // this.total = res.data.data.total;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    seeClick(row) {
      console.log(row);
      this.showLoading();
      let params = {
        jobId: row.id,
      };
      this.$axios({
        method: "get",
        url: `/hire/sendInvitation`,
        headers: {
          Authorization: this.requestToken,
        },
        params: params,
      })
        .then((res) => {
          this.hideLoading();
          if (res.data.code == "20000") {
            this.$message.success("发起邀请成功！");
          } else {
            this.$message({ message: res.data.message, type: "error" });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({ message: err, type: "error" });
        });
    },
    // 详情关闭
    detailsClose() {
      this.detailsFlag = false;
    },
    // 修改
    editClick() {
      this.newaddFlag = true;
    },
    //图片删除
    handleRemove(file, fileList) {
      console.log("file------>", file);
      if (file && file.status === "success") {
        this.showLoading();
        let params = {
          attachmentId: file.fileId,
          attachmentType: "0",
        };
        this.$axios({
          method: "get",
          url: `/hire/deleteAttachment`,
          headers: {
            Authorization: this.requestToken,
          },
          params: params,
        })
          .then((res) => {
            this.hideLoading();
            if (res.data.code == "20000") {
              this.fileUrlList = [];
              this.$message.success("删除成功！");
            } else {
              this.$message({
                message: res.data.message,
                type: "error",
              });
            }
          })
          .catch((err) => {
            this.hideLoading();
            this.$message({
              message: err,
              type: "error",
            });
          });
      }
    },
    beforeRemove2(file, fileList) {
      let a = true;
      return a;
    },
    beforeRemove1(file, fileList) {
      let a = true;
      return a;
    },
    //图片删除
    handleRemove1(file, fileList) {
      let self = this;
      console.log("file------", file);
      console.log("fileList--------", fileList);
      console.log("fileUrluploadList----", this.fileUrluploadList);
      if (file && file.status === "success") {
        this.showLoading();
        let params = {
          attachmentId: file.fileId,
          attachmentType: "1",
        };
        this.$axios({
          method: "get",
          url: `/hire/deleteAttachment`,
          headers: {
            Authorization: this.requestToken,
          },
          params: params,
        })
          .then((res) => {
            this.hideLoading();
            if (res.data.code == "20000") {
              this.fileUrluploadList.forEach((item, index) => {
                if (item.fileId == file.fileId) {
                  self.fileUrluploadList.splice(index, 1);
                }
              });
              this.$message.success("删除成功！");
            } else {
              this.$message({
                message: res.data.message,
                type: "error",
              });
            }
          })
          .catch((err) => {
            this.hideLoading();
            this.$message({
              message: err,
              type: "error",
            });
          });
      }
    },
    //视频删除
    handleRemove2(file, fileList) {
      this.showLoading();
      console.log("videofile----", file);
      let params = {
        attachmentId: file.fileId || file.response.data.id,
        attachmentType: "2",
      };
      this.$axios({
        method: "get",
        url: `/hire/deleteAttachment`,
        headers: {
          Authorization: this.requestToken,
        },
        params: params,
      })
        .then((res) => {
          this.hideLoading();
          if (res.data.code == "20000") {
            // this.fileUrlList = [];
            this.$message.success("删除成功！");
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    //查询企业数量
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    findClose() {
      this.findFlag = false;
    },
    newfindClose() {
      this.newfindFlag = false;
      if (this.newfindFlag == false) {
        this.findFlag = true;
      }
    },
    //产看企业介绍
    handleClick(row) {
      this.newfindFlag = true;
    },
  },
};
</script>
<style scoped>
.common-title-flex {
  display: flex;
}
.common-title-div {
  width: 3px;
  height: 16px;
  background-color: #368af7;
  margin-top: 2px;
}
.common-title-text {
  margin-left: 4px;
  font-size: 14px;
}
.common-list-class {
  display: flex;
  justify-content: space-between;
  margin-top: -10px;
}
.upload-file >>> .el-upload--text {
  border: none;
  width: 100px;
  height: 36px;
}
.el_card_class >>> .el-card__body {
  padding: 10px !important;
}
/* .el-form-item >>>.el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 90px;
  height: 90px;
} */
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
/* .el-form-item{
  font-size: 20px;
  color: #8c939d;
  width: 20px;
  height: 20px;
  line-height: 90px;
  text-align: center;
} */
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
.avatar-uploader >>> .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 70px;
  height: 70px;
}
/* 完善图片上传 */
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  display: block;
  font-size: 22px;
  color: #8c939d;
  width: 70px;
  height: 70px;
  line-height: 70px;
  text-align: center;
}
.avatar {
  width: 70px;
  height: 70px;
  display: block;
}
</style>
